package com.freight.base.service;

import com.freight.base.entity.City;
import com.freight.base.vo.AreaCityVo;
import com.freight.base.vo.CityListVo;
import com.freight.base.vo.CityVo;
import com.freight.core.base.FreightBaseService;
import com.freight.core.common.vo.SearchVo;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.HashMap;
import java.util.List;
import java.util.Set;

/**
 * 城市维表接口
 * @author huyingtai
 */
public interface CityService extends FreightBaseService<City, Long> {

    List<AreaCityVo>  getAreaCityList(String code, String type);

    List<CityListVo> getCityList(String code);

    /**
    * 多条件分页获取
    * @param city
    * @param searchVo
    * @param pageable
    * @return
    */
    Page<City> findByCondition(City city, SearchVo searchVo, Pageable pageable);

    /**
     * 获取城市层级
     * @param cityCode
     * @return CityVo
     */
    CityVo getCityVoLevel(String cityCode);

    /**
     *
     * @param cityCode
     * @return
     */
    List<CityVo> getCityVoLevel(List<String> cityCode);

    /**
     *
     * @param cityCodes
     * @return
     */
    HashMap<String,CityVo> getCityVoLevelMap(List<String> cityCodes);

    /**
     *
     * @param cityCodes
     * @return
     */
    HashMap<String,CityVo> getCityVoLevelMap(Set<String> cityCodes);

}